/**
 * @(#)ChannelApkInfoImpl.java 2016年9月22日
 * Copyright(C) 2015 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.dao.ISystemApkConfigDAO;
import org.jsbd.boss.domian.channel.DaemonApkConfig;
import org.jsbd.boss.domian.channel.SystemApkConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * TODO 请加入本类的说明
 * 
 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
 * @version 1.0.0
 */
@Service
public class SystemApkConfigDAOImpl extends CrackBaseDao implements ISystemApkConfigDAO {
	public static final Logger LOGGER = LoggerFactory.getLogger(SystemApkConfigDAOImpl.class);


	@Override
	public Integer insertConfig(SystemApkConfig apkConfig) {
		return (Integer) super.insert("qy_system_apk_config.INSERT_SYSTEM_APK_CONFIG", apkConfig);
	}

	@Override
	public Integer updateConfig(SystemApkConfig apkConfig) {
		return super.update("qy_system_apk_config.UPDATE_SYSTEM_APK_CONFIG", apkConfig);
	}

	@Override
	public Integer deleteConfig(String mark) {
		return  super.update("qy_system_apk_config.SELECT_SYSTEM_APK_CONFIG", mark);
	}

	@Override
	public List<DaemonApkConfig> selectApkConfigs(SystemApkConfig config) {
		return super.queryForList("qy_system_apk_config.SELECT_SYSTEM_APK_CONFIG", config);
	}

	@Override
	public Map<String, Object> selectConfigPageListMap(SystemApkConfig form) {
		form = (form == null ? new SystemApkConfig() : form);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("total", super.queryForCount("qy_system_apk_config.select_config_page_list_count", form));
		map.put("rows", super.queryForList("qy_system_apk_config.select_config_page_list", form));
		return map;
	}

	@Override
	public SystemApkConfig selectVer(String version) {
		return (SystemApkConfig) super.queryForObject("qy_system_apk_config.SELECT_SYSTEM_APK_CONFIG_BYVERSION", version);
	}

	@Override
	public void phoneTypeEdit(SystemApkConfig daemonApkConfig) {
		super.update("qy_system_apk_config.UPDATE_PHONE_TYPE_EDIT", daemonApkConfig);
	}

	@Override
	public SystemApkConfig selectByVersion(String version) {
		return (SystemApkConfig) super.queryForObject("qy_system_apk_config.SELECT_BY_VERSION", version);
	}
	
}
